package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /**
     * 根据openid查找用户
     * */
    @Select("select * from user where openid=#{openid}")
    User selectUserBYOpenId(String openid);

    /**
     * 插入新用户并返回id
     * */
    Long insertUser(User user);

    @Select("select * from user where id=#{id}")
    User selectById(Long id);

}
